package com.yiyuan.app.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import com.yiyuan.app.entity.po.GConfRoomPrizePO;
import com.yiyuan.app.mapper.GConfRoomPrizeMapper;
import org.springframework.stereotype.Repository;

@Repository
public class GConfRoomPrizeDAO extends BaseDAO<GConfRoomPrizeMapper, GConfRoomPrizePO> {


    public GConfRoomPrizePO findOnePrize(Long roomId, Integer prizeType) {
        LambdaQueryWrapper<GConfRoomPrizePO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(GConfRoomPrizePO::getRoomId, roomId);
        queryWrapper.eq(GConfRoomPrizePO::getPrizeType, prizeType);
        return getBaseMapper().selectOne(queryWrapper);
    }

    public GConfRoomPrizePO findOnePrize(Long roomId, Long prizeId) {
        LambdaQueryWrapper<GConfRoomPrizePO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(GConfRoomPrizePO::getRoomId, roomId);
        queryWrapper.eq(GConfRoomPrizePO::getPrizeId, prizeId);
        return getBaseMapper().selectOne(queryWrapper);
    }
}
